<?php
	function getPageLinks($pagecount)
	{
		if ($pagecount>1)
		{
				if(isset($_GET["page"]))
				{
					$CurrPage = $_GET["page"];
				}
				else $CurrPage = 1;
		
			$PageLink="Trang ";
			for ($i=0;$i<=$pagecount-1;$i++)
			{
				$j=$i+1;
				if ($j==$CurrPage)
					{
						$PageLink.=" {$j} | ";
					}
				else
					{
						$NewGet="";
						reset ($_GET);
						while (list($key, $val) = each($_GET))
						 {				
						 if ($key!='page')						   
						   {
								$NewGet.="{$key}={$val}&";
						   }
						   	
						}
						$NewGet.="page={$j}";
						
						$PageLink.=" <a href='?{$Link}{$NewGet}'>{$j}</a> | ";
					} 
			}
				return $PageLink;
		}

	}
?>